import service from '@/utils/request'

// @Tags Train
// @Summary 创建Train
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Train true "创建Train"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /train/createTrain [post]
export const createTrain = (data) => {
     return service({
         url: "/train/createTrain",
         method: 'post',
         data
     })
 }


// @Tags Train
// @Summary 删除Train
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Train true "删除Train"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /train/deleteTrain [delete]
 export const deleteTrain = (data) => {
     return service({
         url: "/train/deleteTrain",
         method: 'delete',
         data
     })
 }

// @Tags Train
// @Summary 删除Train
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除Train"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /train/deleteTrain [delete]
 export const deleteTrainByIds = (data) => {
     return service({
         url: "/train/deleteTrainByIds",
         method: 'delete',
         data
     })
 }

// @Tags Train
// @Summary 更新Train
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Train true "更新Train"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /train/updateTrain [put]
 export const updateTrain = (data) => {
     return service({
         url: "/train/updateTrain",
         method: 'put',
         data
     })
 }


// @Tags Train
// @Summary 用id查询Train
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Train true "用id查询Train"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /train/findTrain [get]
 export const findTrain = (params) => {
     return service({
         url: "/train/findTrain",
         method: 'get',
         params
     })
 }


// @Tags Train
// @Summary 分页获取Train列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "分页获取Train列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /train/getTrainList [get]
 export const getTrainList = (params) => {
     return service({
         url: "/train/getTrainList",
         method: 'get',
         params
     })
 }

// 给动车设置路线
export const addTrainLines = (data) => {
    return service({
        url: "/train/addTrainLines",
        method: 'post',
        data
    })
}
